<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN" "http://www.w3.org/TR/htmL1/DTD/xhtml1-transitional.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %> 
<%--
    page description : 휴가관리 - 관리자 - 휴가 배정 (pop_up)
    author      : ych D
    date        : 2009-01-22
    file name   : vaca_alloc_p.jsp
--%>
<html>
<head>
	<base target="_self" />
	<link rel="stylesheet" type="text/css" href="/inc/css/common.css" />
	<link rel="stylesheet" href="style/style.css" type="text/css" />
	<script src="inc/js/common.js"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>배정일 조회</title>
</head>
<script type="text/javascript">

	//var args;
	
/*	function fnc_check(field) {
		
		args = new Array();	//배열생성

		if (!field) {
			alert("<s:text name="alert.message.notCheck" />");
			return false;
		}
	
		//체크박스가 하나일 경우 처리하는 로직
		if (!field.length) {
			if (!field.checked) {
				alert("<s:text name="alert.message.requiedCheck"/>");
				field.focus();
				return false;
			} else {
				args.push(field.value);
				return true;
			}
		}
		
		var checkflag = false;	//check init
		
		//체크된것이 없을시에 알람 메시지 출력
		//alert(field.length);	//checkbox 갯수
		for(i = 0 ; i < field.length ; i++) {
			if (!field[i].checked) {
				continue;
			} else {
				checkflag = true;
				//alert(field[i].value)
				args.push(field[i].value);	//배열에 값을 넣는다.
			}
		}
		
		//체크되지 않았으면 메시지 출력
		if (!checkflag) {
			alert("<s:text name="alert.message.selectData" />");
			return false;
		}
	
		return true;
	}
*/
	//전체선택
/*	function selectCheck() {
		
		var check 		= fm.d_chk;
		
		var selectAll 	= fm.selectAll.checked;
		
		if( selectAll ) {
			check.checked = true;
			
			for(i=0 ; i < check.length ; i++){
			   check[i].checked=true;
			}
		} else {
			check.checked = false;
			
			for(i=0 ; i < check.length ; i++){
			   check[i].checked=false;
			}
		}		
	}*/

	/*
	휴가삭제
    */
/*	function fnc_submit(f) {
		if(confirm("휴가정보를 삭제하시겠습니까?")){
			fnc_check(f);
	       // alert("args--------"+args);  // ex)  on,2238
			//hidden값에 체크된 emp_no 담기
			document.getElementById("ch_seq_no").value = args;
	
			f.action = "delete_alloc_vacation_p.action"   //form action 설정.
			f.submit();
	        
			return false;
		}else{
			return false;
		}
	}
*/
	//휴가 삭제후 실행되는 부분.
	function fnc_apply_change(){
    	
		var rtn_msg = document.getElementById("rtn_msg").value;	//저장되었는지 알려줌.
		//var emp_no = document.getElementById("tmp_emp_no").value;
		//var assign_type = document.getElementById("assign_type").value;
       	
		if(rtn_msg.length != 0) {
			//alert(rtn_msg);
			window.close();
			opener.window.fnc_delete(rtn_msg);		//부모창 스크립트 실행.
			//opener.window.fnc_assign_pop(emp_no, assign_type);		//부모창 스크립트 실행.
		} else {
			//가운데 정렬
			if (document.layers) { 
				var x = screen.width / 2 - outerWidth / 2; 
				var y = screen.height / 2 - outerHeight / 2; 
			} else { 
				var x = screen.width / 2 - document.body.offsetWidth / 2; 
				var y = -75 + screen.height / 2 - document.body.offsetHeight / 2; 
			} 
			self.moveTo(x, y); 
		}
	}
</script>
<body onload="PopupAutoResize();fnc_apply_change();">
	<div id="popup_550se_top" ></div>
    <div id="popup_550se_bg">
    	<s:form theme="simple"  name="fm" id="fm" onsubmit="return fnc_submit(this)">
    	<s:hidden id="ch_seq_no" name="ch_seq_no"/>
    	<s:hidden id="rtn_msg"	name="rtn_msg" 	/><!-- return value alert message -->
    	<s:hidden id="tmp_emp_no" name="tmp_emp_no" value="%{tmp_emp_no}" />
    	<s:hidden id="assign_type" name="assign_type" value="%{assign_type}" />
    	<s:hidden id="standard_date" name="standard_date"value="%{standard_date}" />
		<table class="pop550se_Tbl" border="1">
			<tr>
				<!--td class="th_header" style="text-align:center;"><input type="checkbox" id="selectAll" name="selectAll" onclick="selectCheck()" /></td-->
				<td class="th_header" style="text-align:center;">성명</td>
				<td class="th_header" style="text-align:center;">휴가배정<br/>시작일</td>
				<td class="th_header" style="text-align:center;">휴가배정<br/>종료일</td>
				<td class="th_header" style="text-align:center;">휴가종류</td>
				<td class="th_header" style="text-align:center;">휴가배정<br/>일자</td>
				<td class="th_header" style="text-align:center;">배정일수</td>
				<td class="th_header" style="text-align:center;">배정사유</td>
			</tr>
			<s:iterator value="listVacaAssignM">
				<tr>
					<!--td style="text-align:center;"><input type="checkbox" id="d_chk" name="d_chk" value="<s:property value="rownum"/>" <s:if test='close_dt == "Y"' >disabled="disabled"</s:if> /></td-->
					<td style="text-align:center;"><s:property value="emp_nm"/></td>
					<td style="text-align:center;"><s:property value="start_dt"/></td>
					<td style="text-align:center;"><s:property value="end_dt"/></td>
					<td style="text-align:center;"><s:property value="vacation_nm"/></td>
					<td style="text-align:center;"><s:property value="alloc_dt"/></td>
					<td style="text-align:center;"><s:property value="alloc_num"/></td>
					<td style="text-align:center;"><s:property value="remark"/></td>
			    </tr>
			</s:iterator>
			<s:if test="listVacaAssignM.size == 0">
				<tr>
					<td colspan="8" style="text-align:center;">배정된 휴가가 존재하지 않습니다.</td>
				</tr>
			</s:if>
		</table>
		<!--div id="popup_btn"><input type="image" value="삭제" src="/images/btn_sdelete.gif" style="cursor: pointer;" /></div-->
		</s:form>
    </div>
	<br/>
	<!---------------Bottom : STR----------->
	<div id="popup_550se_bottom"><img src="/images/pop_btn_close.gif" style="cursor: pointer;" onclick="window.close();" /></div>
	<!---------------Bottom : END----------->
</body>
</html>